<?php
use yii\db\Schema;
use yii\db\Migration;

/**
 * 广告表
 *
 * @author jois
 */
class m150911_062034_create_advertises_table extends Migration
{

    public function up()
    {
        $this->createTable('advertises', [
            'id' => Schema::TYPE_PK,
            'title' => Schema::TYPE_STRING . ' NOT NULL',
            'img_path' => Schema::TYPE_STRING . ' NOT NULL default \'\'',
            'url' => Schema::TYPE_STRING . ' NOT NULL default \'\'',
            'sort' => Schema::TYPE_INTEGER . ' default 0',
            'created_at' => Schema::TYPE_INTEGER . ' NOT NULL',
            'updated_at' => Schema::TYPE_INTEGER . ' NOT NULL'
        ]);
    }

    public function down()
    {
        $this->dropTable('advertises');
    }
}
